package com.likersai.opon.scene.cultivation.service.rsp;


import com.likersai.opon.scene.cultivation.entity.ConfigRealm;
import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * (ConfigRealm) 保存入参
 *
 * @author sun.ye
 * @since 2024-10-06 17:22:34
 */
@Data
public class ConfigRealmRsp implements Serializable{
    
    private static final long serialVersionUID = 692790858040748505L;

    /**
     * 主键
     */
    private Long id;
    /**
     * 境界名称
     */
    private String realmName;
    /**
     * 境界编码
     */
    private String realmCode;
    /**
     * 境界描述
     */
    private String realmDesc;
    /**
     * 突破需要气
     */
    private Integer qiThreshold;
    /**
     * 境界类型，REALM修真境界
     */
    private String realmType;
    /**
     * 状态
     */
    private Boolean status;
    /**
     * 创建时间
     */
    private Date createDate;
    /**
     * 更新时间
     */
    private Date updateDate;

    public static ConfigRealmRsp from(ConfigRealm entity){
        ConfigRealmRsp rsp = new ConfigRealmRsp();
        if(entity == null){
            return rsp;
        }
        rsp.setId(entity.getId());
        rsp.setRealmName(entity.getRealmName());
        rsp.setRealmCode(entity.getRealmCode());
        rsp.setRealmDesc(entity.getRealmDesc());
        rsp.setQiThreshold(entity.getQiThreshold());
        rsp.setRealmType(entity.getRealmType());
        rsp.setStatus(entity.getStatus());
        rsp.setCreateDate(entity.getCreateDate());
        rsp.setUpdateDate(entity.getUpdateDate());
        return rsp;
    }
    public static List<ConfigRealmRsp> from(List<ConfigRealm> entityList){
        List<ConfigRealmRsp> rspList = new ArrayList<>();
        if(entityList == null || entityList.isEmpty()){
            return rspList;
        }
        for(ConfigRealm entity : entityList){
            rspList.add(from(entity));
        }
        return rspList;
    }


}

